<template>
  <div>
    <tabs />
    <div class="survey">
      <!-- 总览 -->
      <div class="survey-box">
        <el-row type="flex" justify="space-between" align="middle" class="survey-hedaer"><div class="title">总览</div></el-row>
        <el-row type="flex" justify="space-between" class="user">
          <div class="item">
            <div class="title"><count-roll :number="response.total" /></div>
            <div class="name">在售课程</div>
          </div>
          <div class="item">
            <div class="title"><count-roll :number="response.video" /></div>
            <div class="name">点播课程</div>
          </div>
          <div class="item">
            <div class="title"><count-roll :number="response.live" /></div>
            <div class="name">大班课</div>
          </div>
          <div class="item">
            <div class="title"><count-roll :number="response.live_small" /></div>
            <div class="name">小班课</div>
          </div>
          <div class="item">
            <div class="title"><count-roll :number="response.classes" /></div>
            <div class="name">班级课程</div>
          </div>
          <!-- <div class="item">
              <div class="title"><count-roll :number="response.vip_user_count"></count-roll></div>
              <div class="name">面授课程</div>
            </div> -->
        </el-row>
      </div>
      <!-- 课程看板 -->
      <course-column title="课程排行榜" />
      <!-- 课程排行列表 -->
      <course-rank-list />
    </div>
  </div>
</template>

<script>
import Tabs from '../../tabs/index.vue';
import CountRoll from '@/pages/data/components/count_roll';
import CourseColumn from '@/pages/vcharts/box/course/index.vue';
import CourseRankList from './components/course_rank_list.vue';

export default {
  components: {
    Tabs,
    CountRoll,
    CourseColumn,
    CourseRankList
  },
  data() {
    return {
      response: {}
    };
  },
  created() {
    this.$http.get(
      '/admin/data/course/survey',
      {},
      response => {
        this.response = response.data;
      },
      errror => {},
      false
    );
  },
  mounted() {
    this.$store.dispatch('setLoading', 0);
  }
};
</script>

<style lang="scss" scoped>
.survey {
  background-color: #f8f8f8;
  padding-right: 27px;
  //padding-bottom: 16px;
  .survey-box {
    background-color: #fff;
    min-height: 150px;
    margin-bottom: 20px;
    padding: 10px 20px 25px;
    .survey-hedaer {
      margin-bottom: 28px;
      height: 36px;
      padding-right: 20px;
      background-color: #f1f8ff;
      .title {
        color: #303133;
        font-size: 15px;
        padding-left: 6px;
        border-left: 2px solid #5191ff;
      }
    }
    .user {
      .item {
        padding: 18px;
        text-align: center;
        border-radius: 4px;
        width: calc(20% - 20px);
        box-sizing: border-box;
        &:nth-child(1) {
          background: linear-gradient(226deg, rgba(255, 212, 65, 1) 0%, rgba(250, 165, 0, 1) 100%);
        }
        &:nth-child(2) {
          background: linear-gradient(226deg, rgba(115, 164, 255, 1) 0%, rgba(60, 143, 255, 1) 100%);
        }
        &:nth-child(3) {
          background: linear-gradient(226deg, rgba(255, 172, 118, 1) 0%, rgba(255, 142, 70, 1) 100%);
        }
        &:nth-child(4) {
          background: linear-gradient(225deg, rgba(173, 232, 89, 1) 0%, rgba(131, 219, 49, 1) 100%);
        }
        &:nth-child(5) {
          background: linear-gradient(226deg, rgba(255, 149, 132, 1) 0%, rgba(255, 113, 105, 1) 100%);
        }
        .title {
          color: #fff;
          font-weight: bold;
          font-size: 22px;
        }
        .name {
          color: #fff;
          font-size: 14px;
          margin-top: 13px;
        }
      }
    }
  }
}
</style>
